import fetch from "@/utils/fetch";

// 说明：添加集中器水表资料
// 接口：api/cb/flConMeterInfo
// 请求类型：Post
export function addFlConMeterInfo(obj) {
    return fetch({
        url: "api/cb/flConMeterInfo",
        method: "post",
        data: obj,
    });
}

// 说明：删除集中器水表资料
// 接口：api/cb/flConMeterInfo/{ids}
// 请求类型：Delete
export function deleteFlConMeterInfo(idArr) {
    return fetch({
        url: "api/cb/flConMeterInfo/" + idArr,
        method: "delete",
    });
}

// 说明：修改集中器水表资料
// 接口：api/cb/flConMeterInfo/{id}
// 请求类型：Put
export function modifyFlConMeterInfo(id, obj) {
    return fetch({
        url: "api/cb/flConMeterInfo/" + id,
        method: "put",
        data: obj,
    });
}

// 说明：集中器水表资料分页查询(条件搜索)
// 接口：api/cb/flConMeterInfo/search/{page}/{size}
// 请求类型：Post

//集中器
export function searchFlConMeterInfo(communityCode, page, size) {
    return fetch({
        url: `api/cb/flConMeterInfo/findByCommunityCode/${communityCode}/${page}/${size}`,
        method: "get",
    });
}

//抄表记录
export function searchFlConMeterInfo1(communityCode, page, size) {
    return fetch({
        url: `api/cb/flConMeterInfo/findReadRecord/${communityCode}/${page}/${size}`,
        method: "get",
    });
}

//抄表数据
export function searchFlConMeterInfo2(page, size, obj) {
    return fetch({
        //url: 'api/cb/flWaterMeterInfo/search/'+ page +'/'+ size,
        url: "api/cb/flConMeterInfo/search1/" + page + "/" + size,
        method: "post",
        data: obj,
    });
}

// 说明：集中器抄表记录分页查询(条件搜索)
// 接口：api/cb/flConCblog/search/{page}/{size}
// 请求类型：Post
export function searchFlConCblog(page, size, obj) {
    return fetch({
        url: "api/cb/flConCblog/search/" + page + "/" + size,
        method: "post",
        data: obj,
    });
}

// GET /flConcentratorManager/search/{page}/{size}
// 集中器管理 分页查询
// export function searchFlConcentratorManager(page, size) {
//     return fetch({
//         url: 'api/cb/flConCblog/search/'+ page +'/'+ size,
//         method: 'post',
//     });
// }

// GET /flConcentratorManager/search1/{page}/{size}
// 集中器抄表记录 分页查询
export function searchFlConcentratorManager(page, size) {
    return fetch({
        url: "api/cb/flConcentratorManager/search1/" + page + "/" + size,
        method: "get",
    });
}

// 说明：获取单个集中器水表资料
// 接口：api/cb/flConMeterInfo/{id}
// 请求类型：get
export function getFlConMeterInfo(id) {
    return fetch({
        url: "api/cb/flConMeterInfo/" + id,
        method: "get",
    });
}

// 说明：集中器水表资料导出Excel模板
// 接口：api/cb/flConMeterInfo/exprotExcelModel
// 请求类型：get
export function downTem() {
    return fetch({
        url: "api/cb/flConMeterInfo/exprotExcelModel",
        responseType: "blob",
        method: "get",
    });
}

// 说明：集中器水表资料导出Excel数据
// 接口：api/cb/flConMeterInfo/exprotXls/{ids}
// 请求类型：post
export function exprotXls(ids, obj) {
    return fetch({
        url: "api/cb/flConMeterInfo/exprotXls1/" + ids,
        responseType: "blob",
        method: "post",
        data: obj,
    });
}

// 说明：集中器水表资料导入
// 接口：api/cb/flConMeterInfo/importXls
// 请求类型：post
export function importXls() {
    return fetch({
        url: "api/cb/flConMeterInfo/importXls",
        method: "post",
    });
}